import book.BookList;
import user.DomesticConsumer;
import user.Manager;
import user.User;

import java.util.Scanner;

public class Main {

    public static int login(){
        System.out.println("请输入您的身份：");
        System.out.println("1.管理员  2.普通用户");
        Scanner scan = new Scanner(System.in);
        int ret = scan.nextInt();

        return ret;
    }

    public static void main(String[] args) {
        //登录
        int ret = login();

        User user = null;
        if(ret == 1){
            user = new Manager();
        }else{
            user = new DomesticConsumer();
        }

        //初始化
        BookList bookList = new BookList();

        int chose = 1;
        //功能选择
        do{
            chose = user.menu();
            user.work(chose,bookList);
        }while(chose != 0);
    }

}